package com.itdfq.consumer.service;


import com.itdfq.provider.service.TicketService;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Service;

/**
 * @Author GocChin
 * @Date 2021/6/19 15:56
 * @Blog: itdfq.com
 * @QQ: 909256107
 */
@Service //用的是Spring自带的，放入容器中
public class Uservice {
    //拿到provider的票
    @Reference //引用  1:pom坐标 2：定义相同的接口名
            TicketService ticketService;

    public void buyPiao(){
        String ticker = ticketService.getTicker();
        System.out.println("再注册中心拿到票"+ticker);
    }

}
